package com.dempsey.api;

import com.dempsey.api.domain.User;
import com.dempsey.api.factory.RemoteUserFallbackFactory;
import com.dempsey.common.core.domain.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 用户服务
 *
 * @author Dempsey
 */
@FeignClient(name = "user-server", fallbackFactory = RemoteUserFallbackFactory.class)
public interface RemoteUserService {

    // 获取
    @PostMapping("/user/getUserByUsername")
    R<User> getUserByUsername(@RequestParam("username") String username);

    @PostMapping("/user/createUser")
    R<User> createUser(@RequestBody User user);

    @PostMapping("/user/getUserRoleByUserId")
    R<String> getUserRoleByUserId(@RequestParam("userId") int userId);


}
